package com.yima.baseproj.module.app.lunbotu;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yima.baseproj.module.app.lunbotu.model.AppLunbotuAddOrEditParamModel;
import com.yima.baseproj.module.config.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@TableName("app_lunbotu")
public class AppLunbotuEntity extends BaseEntity {

  @ApiModelProperty(value = "图片地址")
  @TableField(value = "img_url")
  private String imgUrl;

  @ApiModelProperty(value = "内容类型：无内容，富文本，页面")
  @TableField(value = "content_type")
  private String contentType;

  @ApiModelProperty(value = "根据内容类型定")
  @TableField(value = "content")
  private String content;

  @ApiModelProperty(value = "状态：1.发布；0.未发布")
  @TableField(value = "state")
  private Integer state;

  @ApiModelProperty(value = "名字。富文本或链接的页面标题")
  @TableField(value = "name")
  private String name;

  @ApiModelProperty(value = "sort")
  @TableField(value = "sort")
  private Integer sort;

  public void setData(AppLunbotuAddOrEditParamModel paramModel){
    this.imgUrl = paramModel.getImgUrl();
    this.contentType = paramModel.getContentType();
    this.content = paramModel.getContent();
    this.state = paramModel.getState();
    this.name = paramModel.getName();
    this.sort = paramModel.getSort();
  }
}